//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package testcase_dao

import "go.mongodb.org/mongo-driver/mongo"

var FolderInfoDao *_FolderInfoDao
var CaseInfoDao *_CaseInfoDao
var LinkSpritDao *_LinkSpritDao
var ResultDao *_ResultDao
var CaseRecycleDao *_CaseRecycleDao

func InitDao(mgoDb *mongo.Database) (err error) {
	FolderInfoDao, err = newFolderInfoDao(mgoDb)
	if err != nil {
		return
	}
	CaseInfoDao, err = newCaseInfoDao(mgoDb)
	if err != nil {
		return
	}
	LinkSpritDao, err = newLinkSpritDao(mgoDb)
	if err != nil {
		return
	}
	ResultDao, err = newResultDao(mgoDb)
	if err != nil {
		return
	}
	CaseRecycleDao, err = newCaseRecycleDao(mgoDb)
	if err != nil {
		return
	}
	return
}
